package com.bill.gaty.mfidelity.type;

public enum SexeType {
	MASCULIN("M"),
	FEMININ("F")
	 
;
	private   final String value;

	public String getValue() {
		return value;
	}

	private SexeType(String value) {
		this.value = value;
	}
	public boolean isMasculin(){return getValue().compareToIgnoreCase("M")==0;}
	public boolean isFeminin(){return getValue().compareToIgnoreCase("F")==0;}
	
	public static SexeType fromString(final String value){
		 if(null==value)return SexeType.MASCULIN;
		 if(value.compareToIgnoreCase("M")==0)return SexeType.MASCULIN;
		 if(value.compareToIgnoreCase("F")==0)return SexeType.FEMININ;
		 		
		 return SexeType.MASCULIN;
	}
	public static SexeType fromInt(final int value){
		  
		 if(value==1)return SexeType.MASCULIN;
		 if(value==2)return SexeType.FEMININ;
		 	
		 return SexeType.MASCULIN;
	}
}
